<html>
 <head>
  <link href="./leetcode-problem.css" rel="stylesheet" type="text/css">
 </head>
 <body>
  <div class="question_difficulty">
   难度：Medium
  </div>
  <div>
   <h1 class="question_title">
    1016. Subarray Sums Divisible by K
   </h1>
   <p>
    Given an array
    <code>
     A
    </code>
    of integers, return the number of (contiguous, non-empty) subarrays that have a sum divisible by
    <code>
     K
    </code>
    .
   </p>
   <p>
    &nbsp;
   </p>
   <div>
    <p>
     <strong>
      Example 1:
     </strong>
    </p>
    <pre>
<strong>Input: </strong>A = <span id="example-input-1-1">[4,5,0,-2,-3,1]</span>, K = <span id="example-input-1-2">5</span>
<strong>Output: </strong><span id="example-output-1">7</span>
<strong>Explanation: </strong>There are 7 subarrays with a sum divisible by K = 5:
[4, 5, 0, -2, -3, 1], [5], [5, 0], [5, 0, -2, -3], [0], [0, -2, -3], [-2, -3]
</pre>
    <p>
     &nbsp;
    </p>
    <p>
     <strong>
      Note:
     </strong>
    </p>
    <ol>
     <li>
      <code>
       1 &lt;= A.length &lt;= 30000
      </code>
     </li>
     <li>
      <code>
       -10000 &lt;= A[i] &lt;= 10000
      </code>
     </li>
     <li>
      <code>
       2 &lt;= K &lt;= 10000
      </code>
     </li>
    </ol>
   </div>
  </div>
  <div>
   <h1 class="question_title">
    1016. 和可被 K 整除的子数组
   </h1>
   <p>
    给定一个整数数组
    <code>
     A
    </code>
    ，返回其中元素之和可被
    <code>
     K
    </code>
    &nbsp;整除的（连续、非空）子数组的数目。
   </p>
   <p>
    &nbsp;
   </p>
   <p>
    <strong>
     示例：
    </strong>
   </p>
   <pre><strong>输入：</strong>A = [4,5,0,-2,-3,1], K = 5
<strong>输出：</strong>7
<strong>解释：
</strong>有 7 个子数组满足其元素之和可被 K = 5 整除：
[4, 5, 0, -2, -3, 1], [5], [5, 0], [5, 0, -2, -3], [0], [0, -2, -3], [-2, -3]
</pre>
   <p>
    &nbsp;
   </p>
   <p>
    <strong>
     提示：
    </strong>
   </p>
   <ol>
    <li>
     <code>
      1 &lt;= A.length &lt;= 30000
     </code>
    </li>
    <li>
     <code>
      -10000 &lt;= A[i] &lt;= 10000
     </code>
    </li>
    <li>
     <code>
      2 &lt;= K &lt;= 10000
     </code>
    </li>
   </ol>
  </div>
 </body>
</html>